# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=hwk
pkgver=0.4
pkgrel=5
groups=('blackarch' 'blackarch-wireless' 'blackarch-fuzzer' 'blackarch-scanner'
        'blackarch-dos')
pkgdesc='Collection of packet crafting and wireless network flooding tools'
arch=('x86_64')
url='http://www.nullsecurity.net/'
license=('GPL-2.0-only')
depends=('libpcap')
source=("https://github.com/nullsecuritynet/tools/raw/main/wireless/$pkgname/release/$pkgname-$pkgver.tar.gz"
        'Makefile.patch')
sha512sums=('3f6f6f22fe68336761339bbf96857b8c9c1ede35def22672808f30d1598682bda624eda26c17c6dc34a03f342a2fd182465e637931ec293241f2ff16182ed4f3'
            'a17b05a4455bebe6f980ad753aee40bdef51fa9fcc2c399f3530abaf3bb8743abc95dbb895a08f63d1a7a59ecc54c9382b4fbf084a9233b23ceeca331c05087f')

prepare() {
  cd "$pkgname-$pkgver"

  patch -Np0 -i "$srcdir/Makefile.patch"
}

build() {
  cd "$pkgname-$pkgver"

  make clean && make
}

package() {
  cd "$pkgname-$pkgver"

  install -Dm 755 bin/hawk "$pkgdir/usr/bin/hawk"
  install -Dm 755 bin/eagle "$pkgdir/usr/bin/hwk-eagle"
  install -Dm 644 doc/COPYING "$pkgdir/usr/share/licenses/hwk/COPYING"
}

